package lt.hsu.product.controller.remote;

import io.swagger.v3.oas.annotations.Hidden;
import jakarta.validation.constraints.NotBlank;
import lombok.extern.slf4j.Slf4j;
import lt.hsu.req.RProduct;
import lt.hsu.web.NoWrap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@Validated
@Hidden
@RequestMapping("remote")
public class RemoteProductController {

    @PostMapping("/product/list")
    @NoWrap
    public List<RProduct> list(){
        return List.of();
    }
    @PostMapping("/product/{productName}")
    @NoWrap
    public RProduct findProduct(@NotBlank(message = "产品名不能为空") @PathVariable("productName") String productName){
        return new RProduct();
    }

}
